<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       Cake.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html>
<html>
    <head>
        <?php echo $this->Html->charset(); ?>
        <title>
            Don Burguer - 
            <?php echo $title_for_layout; ?>
        </title>

        <?php
        echo $this->Html->script(array(
            'jquery-1.9.1',
            'jquery-ui-1.10.2.custom',
            'jquery-ui-1.10.2.custom.min',
            'jquery.numeric',
            'numericValidation',
            'date',
            'suma',
            'flashMessages',
                )
        );
        ?>

        <?php
        echo $this->Html->meta('icon');

        echo $this->Html->css(array(
            'style',
            'layout',
            'burguer-theme/jquery-ui-1.10.2.custom.css',
        ));



        echo $this->fetch('meta');
        echo $this->fetch('css');
        echo $this->fetch('script');
        ?>
    </head>
    <body>
        <div class="Main">

            <div class="Sheet">

                <ul id="topbar">
                    <li><a class="button gray fl" title="Ir a home" href="<?php echo $this->Html->url('/sales/caja') ?>"><span class="icon_single preview"></span></a></li>
                    <li class="s_1"></li>
                    <li class="logo"><strong></strong></li>

                    <?php
//                    Obtengo primer argumento de la url para mostrar en migas de pan
                    $data = explode('/', $_SERVER['REQUEST_URI']);
                    $url = str_replace('_', ' ', $data[1]);
                    ?>
                    <li><a class="breadcrumb " href="<?php echo $this->Html->url('/caja') ?>">Home -&gt; <?php echo ucwords($url); ?> </a></li>
                    <li class="fr"><a class="button gray fl" title="logout" href="<?php echo $this->Html->url('../users/logout') ?>">
                            <span class="icon_text logout"></span>Salir</a></li>

                    <li class="s_1 fr"></li>
                    <li class="fr"><a class="button gray fl" title="admin" href="#"><span class="icon_text admin"></span><?php echo $this->Session->read('Auth.User.name') ?></a></li>
                    <li class="fr"><a id="logged">Logeado como:</a></li>

                    <?php if ($this->Session->read('Auth.User.role') !== 'cajero'): ?>
                        <li class="fr"><a id="logged" href="<?php echo $this->Html->url('/admin') ?>">Administracion</a></li>
                    <?php endif; ?>

                </ul>
                <div class="box-content">

                    <?php echo $this->Session->flash(); ?>

                    <?php echo $this->fetch('content'); ?>
                </div>
            </div>
        </div>

    </body>


</html>
